import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab05VO, Ab05Form, Ab05Query } from '@/api/yuanshidian/ab05/types';

/**
 * 查询个人账户总账列表
 * @param query
 * @returns {*}
 */

export const listAb05 = (query?: Ab05Query): AxiosPromise<Ab05VO[]> => {
  return request({
    url: '/yuanshidian/ab05/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询个人账户总账详细
 * @param ID
 */
export const getAb05 = (ID: string | number): AxiosPromise<Ab05VO> => {
  return request({
    url: '/yuanshidian/ab05/' + ID,
    method: 'get'
  });
};

/**
 * 新增个人账户总账
 * @param data
 */
export const addAb05 = (data: Ab05Form) => {
  return request({
    url: '/yuanshidian/ab05',
    method: 'post',
    data: data
  });
};

/**
 * 修改个人账户总账
 * @param data
 */
export const updateAb05 = (data: Ab05Form) => {
  return request({
    url: '/yuanshidian/ab05',
    method: 'put',
    data: data
  });
};

/**
 * 删除个人账户总账
 * @param ID
 */
export const delAb05 = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab05/' + ID,
    method: 'delete'
  });
};
